﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.LIB;

namespace YJKBatchPrinter
{
	public partial class ReNameForm : System.Windows.Forms.Form
	{
		public ReNameForm(ISettingNameOperation settingWithNameOperation)
		{
			this.InitializeComponent();
			YJKProcessTools hyprocessTools = new YJKProcessTools();
			hyprocessTools.ShowInTaskbarChange(this);
			this.m_settingWithNameOperation = settingWithNameOperation;
			this.previousNameTextBox.Text = (this.newNameTextBox.Text = this.m_settingWithNameOperation.SettingName);
		}

		private void okButton_Click(object sender, EventArgs e)
		{
			this.m_settingWithNameOperation.Rename(this.newNameTextBox.Text);
		}

		private void ReNameForm_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}

		private ISettingNameOperation m_settingWithNameOperation;
	}
}
